<!DOCTYPE html>
<html>
<head>
    <title>浏览器对象</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<!--先编写好网页布局-->
<p id="p1">操作成功</p>
<p><label id="lbl">5</label><span>秒后返回主页</span><a href="#">返回</a></p>

<script type="text/javascript">

    var lbl = document.getElementById('lbl');
    var s = 5;
    var t = 2;
    var mill = setInterval(newWeb, 1000);
    function newWeb() {
        s--;
        lbl.innerHTML = s;
        if (s == 1) {
            window.open("https://www.imooc.com/qadetail/260112", "_blank");
            clearInterval(mill);
        }
    }

    //获取显示秒数的元素，通过定时器来更改秒数。
    //通过window的location和history对象来控制网页的跳转。
</script>
</body>
</html>